/*
   Constraint que impide borrar una entidad de padron si esta asociada a la tabla ctbcos
*/

ALTER TABLE public.ctbcos DROP CONSTRAINT IF EXISTS gestion_ai_ctbcosidpad;

ALTER TABLE public.ctbcos
    ADD CONSTRAINT gestion_ai_ctbcosidpad FOREIGN KEY (idpad)
    REFERENCES public.pad (id) MATCH SIMPLE
    ON UPDATE CASCADE
    ON DELETE RESTRICT;
    
    
-- ===================================
SELECT aaVersion('470.01', '470.00');
-- ===================================

